package ulric.kit;

import java.io.File;

public class PathKit {

	public static String getRootClassPath(Class<?> clazz) {
		try {
			String path = clazz.getClassLoader().getResource("").toURI()
					.getPath();
			return new File(path).getAbsolutePath();
		} catch (Exception e) {
			String path = PathKit.class.getClassLoader().getResource("")
					.getPath();
			return new File(path).getAbsolutePath();
		}
	}

	public static void main(String[] args) {
		System.out.println(getRootClassPath(PathKit.class));
	}
}
